package com.medical.admin.sys.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.medical.admin.sys.entity.Admin;
import com.medical.admin.sys.entity.Inform;

import java.util.List;


/*
 * @Date : 2024/4/28 下午3:48
 * @Created by Lang
 * @ProjectName : medical-appointment-registration
 */
    
public interface InformMapper extends BaseMapper<Inform> {
    default Inform selectByInformHeadline(String marInformHeadline){
        return selectOne(new LambdaQueryWrapper<Inform>().eq(Inform::getMarInformHeadline,marInformHeadline));
    }

    default Integer delById(Long informId){
        LambdaUpdateWrapper<Inform> eq = new LambdaUpdateWrapper<Inform>().set(Inform::getMarInformStatus, 0).eq(Inform::getMarInformId, informId);
        return this.update(eq);

    }

    default Integer modStatusByBatch(List<Long> informIds){
        LambdaUpdateWrapper<Inform> in = new UpdateWrapper<Inform>().lambda().set(Inform::getMarInformStatus, 0).in(Inform::getMarInformId, informIds);
        return this.update(in);
    }

}